package com.credithc.customers.manager.echarts;

import com.credithc.customers.manager.po.CustomerModifyPo;
import com.github.abel533.echarts.code.Orient;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhukai
 * @date 2018/12/18 14:00
 */
public class CustomerModifyAddLine extends EChartsCommon {


    private static List<String> rowList = new ArrayList<>();

    static {
        rowList.add("新增量");
        rowList.add("变更量");
    }

    public CustomerModifyAddLine(List<CustomerModifyPo> pos, List<String> colList) {
        super(rowList, colList);
        for (CustomerModifyPo po : pos) {
            setValue(po.getType(), po.getDate(), po.getCount());
        }
    }

    public String generateGraph() {
        return createGraph(null, null).createGrid(30, 50, 30, 150).createCategoryXAxis(columnList, true, true).createValueYAxis("", null, null,true).createLine(true,true).createLeftLegend(rowList, 0, 0, Orient.horizontal).toJSONString();
    }
}
